/*
 * @Author: your name
 * @Date: 2022-01-22 11:41:35
 * @LastEditTime: 2022-01-22 11:43:41
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \my-app\src\store\hooks\index.ts
 */
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'
import { store } from '@/store/Index'
// Infer the `RootState` and `AppDispatch` types from the store itself
export type RootState = ReturnType<typeof store.getState>
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch
export const useAppDispatch = () => useDispatch<AppDispatch>()
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector
